/**
 * Created with IntelliJ IDEA.
 * Description:
 * https://gitee.com/li--jiaqiang/java-test.git
 * git pull
 * git pull origin master
 * git pull origin master --allow-unrelated-histories
 * User: 86187
 * Date: 2022-05-14
 * Time: 17:13
 */

//Scanner scan = new Scanner(System.in);

class MyValue {
    public int val;
}

public class Test {

    /**
     * 交换两个数
     * @param myValue1
     * @param myValue2
     */
    public static void swap(MyValue myValue1,MyValue myValue2) {
        int tmp = myValue1.val;
        myValue1.val = myValue2.val;
        myValue2.val = tmp;
    }

    public static void main(String[] args) {
        MyValue myValue1 = new MyValue();
        myValue1.val = 10;

        MyValue myValue2 = new MyValue();
        myValue2.val = 20;

        System.out.println(myValue1.val+" "+myValue2.val);
        System.out.println("==============");

        swap(myValue1,myValue2);
        System.out.println(myValue1.val+" "+myValue2.val);
    }
}
